package com.nebula.salary.generator.config;

import com.baomidou.mybatisplus.generator.config.StrategyConfig;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;

/**
 * Strategy配置
 *
 * @author codex
 * @since 2022-01-15
 */
public class Strategy {
    public static StrategyConfig getStrategyConfig() {
        StrategyConfig sc = new StrategyConfig();
        sc.setNaming(NamingStrategy.underline_to_camel);
        sc.setColumnNaming(NamingStrategy.underline_to_camel);
        sc.setEntityLombokModel(true);
        sc.setTablePrefix("tb_");
        sc.setInclude("tb_benefits", "tb_common", "tb_navigation", "tb_question", "tb_answer",
                "tb_role", "tb_role_navigation", "tb_salary", "tb_user", "tb_work_overtime");
        sc.setLogicDeleteFieldName("is_deleted");
        sc.setRestControllerStyle(true);
        // 生成实体类常量
        sc.setEntityColumnConstant(true);
        // 移除字段的is_前缀
        sc.setEntityBooleanColumnRemoveIsPrefix(true);
        
        return sc;
    }
}
